if (self.CavalryLogger) { CavalryLogger.start_js(["sT6li"]); } __d("LiveVideoRewindTypedLogger",["Banzai","GeneratedLoggerUtils","nullthrows"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){this.$1={}}var c=a.prototype;c.log=function(){b("GeneratedLoggerUtils").log("logger:LiveVideoRewindLoggerConfig",this.$1,b("Banzai").BASIC)};c.logVital=function(){b("GeneratedLoggerUtils").log("logger:LiveVideoRewindLoggerConfig",this.$1,b("Banzai").VITAL)};c.logImmediately=function(){b("GeneratedLoggerUtils").log("logger:LiveVideoRewindLoggerConfig",this.$1,{signal:!0})};c.clear=function(){this.$1={};return this};c.getData=function(){return babelHelpers["extends"]({},this.$1)};c.updateData=function(a){this.$1=babelHelpers["extends"]({},this.$1,a);return this};c.setActionSequenceNumber=function(a){this.$1.action_sequence_number=a;return this};c.setDeviceid=function(a){this.$1.deviceid=a;return this};c.setEvent=function(a){this.$1.event=a;return this};c.setPositionAfter=function(a){this.$1.position_after=a;return this};c.setPositionBefore=function(a){this.$1.position_before=a;return this};c.setSessionID=function(a){this.$1.session_id=a;return this};c.setTime=function(a){this.$1.time=a;return this};c.setVC=function(a){this.$1.vc=a;return this};c.setVideoDuration=function(a){this.$1.video_duration=a;return this};c.setVideoID=function(a){this.$1.video_id=a;return this};c.setWeight=function(a){this.$1.weight=a;return this};return a}();c={action_sequence_number:!0,deviceid:!0,event:!0,position_after:!0,position_before:!0,session_id:!0,time:!0,vc:!0,video_duration:!0,video_id:!0,weight:!0};e.exports=a}),null); __d("AsyncRequestUtil",["Promise"],(function(a,b,c,d,e,f){"use strict";a={send:function(a){return new(b("Promise"))(function(b,c){return a.setHandler(b).setErrorHandler(c).send()})}};e.exports=a}),null); __d("getContextualLayerCursorOffset",[],(function(a,b,c,d,e,f){"use strict";__p&&__p();function a(a,b,c){__p&&__p();var d=a.getOrientation(),e=d.getPosition();d=d.getAlignment();var f=a.getContent().getBoundingClientRect();a=a.getContext().getBoundingClientRect();b=b-a.left;c=c-a.top;switch(d){case"left":b-=f.width;break;case"center":b-=a.width*.5;break;case"right":b-=a.width-f.width;break;default:throw new Error("invalid alignment")}switch(e){case"above":break;case"left":b+=f.width;c-=f.height*.5;break;case"right":b-=f.width;c-=f.height*.5;break;case"below":c-=a.height;break;default:throw new Error("invalid position")}return{offsetX:b,offsetY:c}}e.exports=a}),null); __d("VideoChannelProgressCircle.react",["cx","React","ReactDOM","Style"],(function(a,b,c,d,e,f,g){__p&&__p();a=b("React").PropTypes;c=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f0;return this.$3||a};c.$14=function(a,b,c){var d={};d.event=a;d.request_status=b;d.perf_time_ms=Date.now()-c;g&&(d.video_channel_id=this.$8)};c.fetchFirstStory=function(a,c,d){__p&&__p();var e=this;if(c===null&&this.$5.length!==0){var f=this.$5.indexOf(this.$7);c=this.$6[f]}f=b("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",this.$4).setStringVector("video_ids",[this.$7]).setString("root_video_id",this.$7).setBool("is_first_story",!0).setBool("use_video_placeholder",a).setBool("setup_interactions",d).setString("channel_id",this.$8).setString("ad_impression_token",this.$11);c&&f.setStringVector("feed_tracking_data",[JSON.stringify(c)]);var h=Date.now();a=new(b("AsyncRequest"))(f.getURI()).setAllowCrossPageTransition(!0).setHandler(function(){__p&&__p();e.$14("fetch_first_story_success","succeeded",h);e.$15();if(g){var a=Date.now(),d=b("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",e.$4).setStringVector("video_ids",[e.$7]).setString("root_video_id",e.$7).setString("channel_id",e.$8).setBool("fetch_channel_pivots",!0);c&&d.setStringVector("feed_tracking_data",[JSON.stringify(c)]);d=new(b("AsyncRequest"))(d.getURI()).setAllowCrossPageTransition(!0).setHandler(function(){e.$14("fetch_channel_pivots_success","succeeded",a),e.$15()}).setErrorHandler(function(){e.$14("fetch_channel_pivots_success","failed",a),e.$15()}).setAbortHandler(function(){e.$14("fetch_channel_pivots_success","aborted",a),e.$15()});e.$1=d;e.$10=Date.now();d.send()}}).setErrorHandler(function(){e.$14("fetch_first_story_success","failed",h),e.$15()}).setAbortHandler(function(){e.$14("fetch_first_story_success","aborted",h),e.$15()});this.$1=a;this.$10=Date.now();a.send()};c.getPreloadedData=function(){return{stories:this.$12,thumbnails:this.$13}};c.$16=function(a,c){__p&&__p();var d=this;if(!this.$8)return;a=b("XVideoChannelViewAsyncController").getURIBuilder().setString("id",this.$8).setEnum("caller",this.$4).setString("original_video_id",this.$7).setInt("story_count",a);this.$2&&a.setString("cursor",this.$2.toString());var e=Date.now();a=a.getURI();a=new(b("AsyncRequest"))(a).setAllowCrossPageTransition(!0).setHandler(function(a){d.$14("fetch_stories_from_entquery","succeeded",e),d.$2=a.getPayload().cursor,d.$3=a.getPayload().hasNextPage,d.$15(),d.$17(a,function(a,b){d.$12=[].concat(d.$12,a);d.$13=[].concat(d.$13,b);return c(a,b)})}).setErrorHandler(function(){d.$14("fetch_stories_from_entquery","failed",e),d.$15()}).setAbortHandler(function(){d.$14("fetch_stories_from_entquery","aborted",e),d.$15()});this.$1=a;a.send()};c.$18=function(a,c,d){__p&&__p();var e=this,f=this.$9.end,g=this.$5.length-f,h=f+Math.min(g,a);if(g>0){var i=this.$5.slice(f,h);f=this.$6.slice(f,h).map(function(a){return JSON.stringify(a)});i=b("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",this.$4).setString("channel_id",this.$8).setString("root_video_id",this.$7).setStringVector("video_ids",i).setStringVector("feed_tracking_data",f);var j=Date.now();this.$1=new(b("AsyncRequest"))(i.getURI()).setAllowCrossPageTransition(!0).setErrorHandler(function(){e.$14("fetch_stories_forward","failed",j),e.$15()}).setAbortHandler(function(){e.$14("fetch_stories_forward","aborted",j),e.$15()}).setHandler(function(a){e.$14("fetch_stories_forward","succeeded",j),e.$9.end=h,e.$15(),e.$17(a,function(a,b){e.$12=[].concat(e.$12,a);e.$13=[].concat(e.$13,b);return c(a,b)})});this.$1.send();d&&d(g)}else this.$3&&(this.$16(a,c),d&&d(a))};c.$19=function(a,c,d){__p&&__p();var e=this,f=this.$9.start;if(f>0){var g=Math.max(f-a,0);a=this.$5.slice(g,f);var h=this.$6.slice(g,f).map(function(a){return JSON.stringify(a)});a=b("XVideoChannelViewStoryAsyncController").getURIBuilder().setEnum("caller",this.$4).setString("channel_id",this.$8).setString("root_video_id",this.$7).setStringVector("video_ids",a).setStringVector("feed_tracking_data",h);var i=Date.now();this.$1=new(b("AsyncRequest"))(a.getURI()).setAllowCrossPageTransition(!0).setErrorHandler(function(){e.$14("fetch_stories_backward","failed",i),e.$15()}).setAbortHandler(function(){e.$14("fetch_stories_backward","aborted",i),e.$15()}).setHandler(function(a){e.$14("fetch_stories_backward","succeeded",i),e.$9.start=g,e.$15(),e.$17(a,c)});this.$1.send();d&&d(f-g)}};c.fetchStories=function(a,c,d){var e=b("VideoChannelViewVariables").defaultStoriesToLoad;if(this.$1)return;a?this.$18(e,c,d):this.$19(e,c,d)};c.$17=function(a,c){a=a.getPayload();var d=b("HTML").replaceJSONWrapper(a.stories).getNodes();a=a.thumbnails.map(function(a){return b("HTML").replaceJSONWrapper(a).getRootNode()});c(d,a)};c.$15=function(){this.$1=null};return a}();e.exports=a}),null); __d("XLiveClipVideoInternalSubmitController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/videos/clipping/submit/",{video_id:{type:"Int",required:!0},start_seconds:{type:"Int"},end_seconds:{type:"Int"}})}),null); __d("XLiveVideoClippingShareDialogController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/live/clipping/share/dialog/",{video_id:{type:"FBID",required:!0},show_preview:{type:"Bool",defaultValue:!1},start_seconds:{type:"Int"},end_seconds:{type:"Int"},enable_scrubber:{type:"Bool",defaultValue:!1}})}),null); __d("ClippingApi",["regeneratorRuntime","Arbiter","AsyncRequest","AsyncRequestUtil","XLiveClipVideoInternalSubmitController","XLiveVideoClippingShareDialogController","gkx"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(){}var c=a.prototype;c.clipVideo=function(a,c,d,e){__p&&__p();var f,g,h,i;return b("regeneratorRuntime").async(function(j){__p&&__p();while(1)switch(j.prev=j.next){case 0:f=Math.round(c);if(!e){j.next=5;break}d=b("XLiveVideoClippingShareDialogController").getURIBuilder().setFBID("video_id",a).setBool("show_preview",!1).setInt("start_seconds",f-30).setInt("end_seconds",f).setBool("enable_scrubber",e).getURI();new(b("AsyncRequest"))(d).setHandler(function(){b("Arbiter").inform("GamesVideoClipping/clipReady")}).send();return j.abrupt("return");case 5:g=b("XLiveClipVideoInternalSubmitController").getURIBuilder().setInt("end_seconds",f).setInt("video_id",a).getURI();j.next=8;return b("regeneratorRuntime").awrap(b("AsyncRequestUtil").send(new(b("AsyncRequest"))(g).setMethod("POST")));case 8:h=j.sent;if(!b("gkx")("681541")){j.next=11;break}return j.abrupt("return");case 11:i=h.payload.clipID,this.shareClip(i.toString());case 13:case"end":return j.stop()}},null,this)};c.shareClip=function(a){a=b("XLiveVideoClippingShareDialogController").getURIBuilder().setFBID("video_id",a).setBool("show_preview",!1).getURI();new(b("AsyncRequest"))(a).setHandler(function(){b("Arbiter").inform("GamesVideoClipping/clipReady")}).send()};return a}();e.exports=new a()}),null); __d("VideoScrollTracker",["Scroll"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(){__p&&__p();function a(a){this.$2=-1,this.$3=!1,this.$4=a}var c=a.prototype;c.$5=function(){return this.$4?b("Scroll").getTop(this.$4):null};c.onScroll=function(){if(this.$3){var a=this.$5();a!==null&&a!==void 0&&(this.$1=a=c.length)break;f=c[e++]}else{e=c.next();if(e.done)break;f=e.value}f=f;var h=b("VideoPlayerShakaGlobalConfig").getString("defer_which_video_to_abort_loading_decisioning_logic","all"),i=f.getVideoPlayerController();i=i?i.isLiveVideo():null;if(i!==null&&(h==="vod"&&i||h==="live"&&!i))continue;if(!f.isState("playing")&&typeof f.abortLoading==="function"&&a.shouldAbortLoadingVideoUnit(f))b("VideoPlayerExperiments").abortLoadingHelperNegativeYAbortLoading?this.$3(f):this.$4(f);else if(b("VideoPlayerExperiments").abortLoadingHelperNegativeYAbortLoading&&f.isState("playing")){h=this.$2.get(f);!h&&g(0,3497);h&&h.abortedLoading&&(h.abortedLoading=!1)}}};c.$3=function(a){if(b("VideoPlayerExperiments").abortLoadingHelperBoundedReloading){var c=b("getViewportDimensions")().height/-2;a.getDistanceToViewport()b("VideoPlayerExperiments").reloadingPixelBoundary+c&&this.$6(a)}else a.getDistanceToViewport()<0&&!a.isVisible()&&this.$5(a)};c.addVideoUnit=function(a){this.$1.has(a)||(this.$1.add(a),this.$2.set(a,{y:a.getDistanceToViewport(),timestamp:new Date().valueOf(),v:0,abortedLoading:!1}))};c.removeVideoUnit=function(a){this.$1["delete"](a),this.$2["delete"](a)};c.calculateFutureScrollPosition=function(a){var b=a.y1-a.y0,c=a.t1-a.t0;b=b/c;var d=b-a.v0;d=d/c;c=a.t;c=d*c*c/2+c*b+a.y1;return{v1:b,a:d,S:c}};c.preloadClosestVideoUnits=function(a){var b=this;this.$7(a).forEach(function(a){return b.$6(a)})};c.$7=function(a){return Array.from(this.$1).filter(function(a){return a.getDistanceToViewport()>=0}).sort(function(a,b){return a.getDistanceToViewport()-b.getDistanceToViewport()}).slice(0,a)};c.$6=function(a){var b=this.$2.get(a);!b&&g(0,3497);var c;b&&(c=b.abortedLoading,b.abortedLoading=!1);c&&typeof a.preload==="function"&&a.preload()};c.$5=function(a){var b=this.$2.get(a);!b&&g(0,3497);var c;b&&(c=b.abortedLoading,b.abortedLoading=!0);!c&&typeof a.abortLoading==="function"&&a.abortLoading()};c.$4=function(a){__p&&__p();var c=b("getViewportDimensions")().height,d=1600;c=c/2;var e=c+d;c=-c;c=c-d;d=this.$2.get(a);!d&&g(0,3497);if(!d)return;var f=a.getDistanceToViewport(),h=d.y;d.y=f;var i=new Date().valueOf(),j=d.timestamp;d.timestamp=i;var k=d.v;if(c<=f&&e>=f){d.abortedLoading&&this.$6(a);return}var l=500;h=this.calculateFutureScrollPosition({y0:h,y1:f,t0:j,t1:i,v0:k,t:l});d.v=h.v1;j=h.S;d.abortedLoading?(fc||f>e&&jd);c=c.slice(0,e);return c.length<=a}}function i(a,c,d){__p&&__p();var e=null;return function(){__p&&__p();for(var f=arguments.length,g=new Array(f),h=0;h-1){this.$10.splice(b,1);b=a.getVideoPlayerController();b&&b.unregisterOption("VideoAutoplayControllerBase/VideoScrollTracker","getLastScrollDirection")}};c.getPlayingVideoUnit=function(){return this.$3};c.setPlayingVideoUnit=function(a){this.$3=a,this.$3&&this.setupPlayingVideoUnitSubscriptions()};c.getLastScrollDirection=function(){return this.$11?this.$11.getLastScrollDirection():null};c.playVideo=function(a,c){__p&&__p();if(b("VideoPlayerExperiments").disableAutoplayForInactiveTab&&b("Visibility").isHidden()){if(b("VideoPlayerExperiments").removeHiddenVideoTracking){this.setPlayingVideoUnit(null);return}this.$2=a;return}this.setPlayingVideoUnit(a);if(this.$3){a=this.$6;a?this.$7=a.call(this,c):this.$3.playWithoutUnmute(c)}};c.setupPlayingVideoUnitSubscriptions=function(){throw new Error("Should be overridden")};c.addSubscriberVideoUnit=function(){this.getVideoUnits().length||(this.$5.addSubscriptions(b("Event").listen(window,"resize",this.updateAutoplay.bind(this)),b("Event").listen(window,"blur",this.$12.bind(this)),b("Event").listen(window,"focus",this.$13.bind(this)),b("Visibility").addListener(b("Visibility").HIDDEN,this.$12.bind(this)),b("Visibility").addListener(b("Visibility").VISIBLE,this.$13.bind(this)),b("Arbiter").subscribe(b("DesktopHscrollUnitEventConstants").HSCROLL_ITEM_SHOWN_EVENT,this.updateAutoplay.bind(this))),this.$14()||this.$15())};c.$12=function(){b("VideoPlayerExperiments").removeHiddenVideoTracking?this.$16("page_visibility_initiated"):this.$2||(this.$2=this.getPlayingVideoUnit(),this.$16("page_visibility_initiated"))};c.$13=function(){b("VideoPlayerExperiments").removeHiddenVideoTracking?this.updateAutoplay():this.$2&&(this.playVideo(this.$2,"page_visibility_initiated"),this.$2=null)};c.$15=function(){__p&&__p();var a=this,c=function(){a.$11&&a.$11.onScroll(),a.updateAutoplay()};this.$4&&this.$4.remove();this.$8=b("throttle")(c,this.$1);this.$9=b("debounce")(function(){return a.updateAutoplay()},this.$1);var d=b("VideoPlayerShakaGlobalConfig").getBool("autoplay_use_unthrottled_scroll_handler",!1)?function(){return c()}:function(){a.$8(),b("VideoPlayerExperiments").useDebouncedScroll&&a.$9()};this.$4=b("Event").listen(window,"scroll",d)};c.$14=function(){return!!this.$4};c.getClosestVideoUnits=function(a){return this.$10.filter(function(a){return a.getDistanceToViewport()>=0}).sort(function(a,b){return a.getDistanceToViewport()-b.getDistanceToViewport()}).slice(0,a)};c.getVisibleUnits=function(){var a=[],c=b("VideoPlayerShakaGlobalConfig").getBool("do_not_emit_become_visibility_events_on_vpc",!1);this.$10.forEach(function(b){var d=b.getVideoPlayerController();b.isVisible()?(a.push(b),b.wasVisible||(b.wasVisible=!0,b.logDisplayed(),!c&&d&&d.emit("becomeVisible"))):b.wasVisible&&(!c&&d&&d.emit("becomeInvisible"),b.wasVisible=!1)});return a};c.$17=function(a){var c=b("VideoPlayerShakaGlobalConfig").getBool("oz_www_allow_abort_loading_from_autoplay_controller",!1),d=b("VideoPlayerShakaGlobalConfig").getString("defer_which_video_to_abort_loading_decisioning_logic","all"),e=a.getVideoPlayerController();if(!c&&e&&e.isPlayerVersion("oz"))return!1;c=e?e.isLiveVideo():null;return c!==null&&(d==="vod"&&c||d==="live"&&!c)?!1:b("VideoAutoplayControllerAbortLoadingHelper").shouldAbortLoadingVideoUnit(a)};c.pausePlayingVideo=function(a,c){__p&&__p();var d=this.$3;if(d){var e=function a(){if(!d.isState("playing")){if(b("VideoPlayerExperiments").abortLoadingReUpStillVisibleVideos&&d.isVisible()){b("setTimeout")(a,g);return}typeof d.abortLoading==="function"&&d.abortLoading()}};if(d.isVisible()){var f=d.getVideoPlayerController();if(f&&f.isPlayRequestPending())return}this.$7()||d.pause(a);b("VideoPlayerExperiments").decoupleAbortLoadingFromPause||this.$17(d)&&!c&&b("setTimeout")(e,g);this.$3=null}};c.$16=function(a){this.pausePlayingVideo(a,!0)};c.updateAutoplay=function(){throw new Error("Should be overridden")};return a}();e.exports=a}),null); __d("XVideoAutoplayNuxAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/video/autoplay/nux/",{})}),null); __d("XVideoAutoplayNuxDismissAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/video/autoplay/nux/dismiss/",{})}),null); __d("XVideoAutoplayNuxLogViewAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/video/autoplay/nux/log/view/",{})}),null); __d("requestBoundedAnimationFrame",["cancelAnimationFrame","clearTimeout","performanceNow","requestAnimationFrame","setTimeout"],(function(a,b,c,d,e,f){a=function(a,c,d){var e=b("setTimeout")(function(){e=null,f!==null&&b("cancelAnimationFrame")(f),a(b("performanceNow")())},d),f=b("requestAnimationFrame")(function(c){f=null,e!==null&&b("clearTimeout")(e),a(c)},c);return function(){f!==null&&(b("cancelAnimationFrame")(f),f=null),e!==null&&(b("clearTimeout")(e),e=null)}};e.exports=a}),null); __d("VideoAutoplayControllerX",["csx","AsyncRequest","DocumentFocusForMutedVideoAutoplayRule","DOM","Event","Network","Run","SubscriptionsHandler","VideoAutoplayControllerAbortLoadingHelper","VideoAutoplayControllerBase","VideoPlayerExperiments","VideoPlayerPreloadExperiment","VideoPlayerShakaGlobalConfig","XVideoAutoplayNuxAsyncController","XVideoAutoplayNuxDismissAsyncController","XVideoAutoplayNuxLogViewAsyncController","clearTimeout","destroyOnUnload","getViewportDimensions","performanceNow","requestBoundedAnimationFrame","requestIdleCallback","setTimeout"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h=null,i=b("VideoPlayerExperiments").videoPollingFrequency,j=!1;function k(){return!b("VideoPlayerExperiments").delayAutoplayUntilAfterLoad||j}a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){__p&&__p();var c;c=a.call(this,i)||this;c.$VideoAutoplayControllerX4=!1;c.$VideoAutoplayControllerX5=!1;c.$VideoAutoplayControllerX6=0;c.$VideoAutoplayControllerX17=new(b("VideoAutoplayControllerAbortLoadingHelper"))();c.$VideoAutoplayControllerX10=new(b("SubscriptionsHandler"))();c.$VideoAutoplayControllerX18=new(b("SubscriptionsHandler"))();c.$VideoAutoplayControllerX12=!0;c.$VideoAutoplayControllerX9=!0;c.$VideoAutoplayControllerX13=!0;c.$VideoAutoplayControllerX2=null;c.$VideoAutoplayControllerX1=null;c.$VideoAutoplayControllerX14=!1;c.$VideoAutoplayControllerX3=null;c.$VideoAutoplayControllerX7=!1;c.$VideoAutoplayControllerX16=!1;c.$VideoAutoplayControllerX15=!1;var d=b("XVideoAutoplayNuxAsyncController").getURIBuilder().getURI();new(b("AsyncRequest"))(d).setAllowCrossPageTransition().send();b("destroyOnUnload")(function(){c.$VideoAutoplayControllerX19(),b("VideoPlayerExperiments").disableAutoplayOnHomePgUpPgDownEnd&&(c.$VideoAutoplayControllerX11&&b("clearTimeout")(c.$VideoAutoplayControllerX11),c.$VideoAutoplayControllerX8.remove()),babelHelpers.assertThisInitialized(c)===h&&(h=null)});b("Run").onAfterLoad(function(){j=!0,b("VideoPlayerExperiments").delayAutoplayUntilAfterLoad&&(h&&h.updateAutoplay()),document.hasFocus()||b("Event").fire(window,"blur"),b("VideoPlayerExperiments").disableAutoplayOnHomePgUpPgDownEnd&&c.$VideoAutoplayControllerX20()});b("VideoPlayerShakaGlobalConfig").getBool("use_two_frequency_update_autoplay",!1)&&c.$VideoAutoplayControllerX21(Date.now());return c}c.$VideoAutoplayControllerX22=function(a){return b("VideoPlayerExperiments").fixVPCCallBeforeLoaded?!(a.isState("fallback")||a.isState("loading")):!0};var d=c.prototype;d.$VideoAutoplayControllerX20=function(){__p&&__p();var a=this,c=33,d=34,e=35,f=36;this.$VideoAutoplayControllerX11=null;var g=function(){a.$VideoAutoplayControllerX23(a.$VideoAutoplayControllerX9),b("clearTimeout")(a.$VideoAutoplayControllerX11),a.$VideoAutoplayControllerX11=null};this.$VideoAutoplayControllerX8=b("Event").listen(document.body,"keydown",function(h){var i=-1;switch(h.keyCode){case c:case d:i=b("VideoPlayerExperiments").pressPgUpPgDownAutoplayShutoffInterval;break;case e:case f:i=b("VideoPlayerExperiments").pressHomeEndAutoplayShutoffInterval;break;default:break}i>-1&&(a.$VideoAutoplayControllerX11?(b("clearTimeout")(a.$VideoAutoplayControllerX11),a.$VideoAutoplayControllerX11=b("setTimeout")(g,i)):a.$VideoAutoplayControllerX12&&(a.$VideoAutoplayControllerX23(!1),a.$VideoAutoplayControllerX11=b("setTimeout")(g,i)))})};d.$VideoAutoplayControllerX23=function(a){this.$VideoAutoplayControllerX12=a,this.updateAutoplay()};c.registerVideoUnit=function(a){__p&&__p();h==null&&(h=new c());h.addSubscriberVideoUnit();h.registerDefaultAutoplayRules(a);h.addVideoUnit(a);var d=new(b("SubscriptionsHandler"))();d.addSubscriptions.apply(d,h.$VideoAutoplayControllerX24(a));h.$VideoAutoplayControllerX25();a.isVisible()&&k()&&h.updateAutoplay();h.shouldRestoreAllSubsequentStreamBufferSizes()&&h.restoreStreamBufferSize();return function(){h&&h.removeVideoUnit(a),d.release(),h&&a===h.getPlayingVideoUnit()&&(h.$VideoAutoplayControllerX18.release(),h.setPlayingVideoUnit(null))}};c.setShouldAutoplay=function(a){h==null&&(h=new c()),h.$VideoAutoplayControllerX12=a,h.$VideoAutoplayControllerX13=a,h.$VideoAutoplayControllerX9=a,h.updateAutoplay()};d.$VideoAutoplayControllerX19=function(){this.$VideoAutoplayControllerX10.release(),this.$VideoAutoplayControllerX18.release()};c.setAutoplayNux=function(a,c){__p&&__p();var d=h;if(!d)return;d.$VideoAutoplayControllerX2=a;d.$VideoAutoplayControllerX1=c;d.$VideoAutoplayControllerX14=!0;a=b("DOM").find(c.getContentRoot(),"._5cqr");b("Event").listen(a,"click",function(){d.$VideoAutoplayControllerX26()});a=b("DOM").scry(c.getContentRoot(),"._36gl")[0];a&&b("Event").listen(a,"click",function(){d.$VideoAutoplayControllerX26()})};d.$VideoAutoplayControllerX26=function(){this.$VideoAutoplayControllerX1&&this.$VideoAutoplayControllerX1.hide();this.$VideoAutoplayControllerX14=!1;var a=b("XVideoAutoplayNuxDismissAsyncController").getURIBuilder().getURI();new(b("AsyncRequest"))(a).setAllowCrossPageTransition().send()};d.registerDefaultAutoplayRules=function(a){b("VideoPlayerExperiments").useBringYourOwnAutoplayRule&&b("VideoPlayerExperiments").pauseMutedIfNoDocumentFocus&&a.registerAutoplayRule(new(b("DocumentFocusForMutedVideoAutoplayRule"))(a))};d.setupPlayingVideoUnitSubscriptions=function(){__p&&__p();var a=this,c=this.getPlayingVideoUnit();if(!c)return;c.addListener&&(this.$VideoAutoplayControllerX10.release(),this.$VideoAutoplayControllerX10.engage(),c.isLooping()||this.$VideoAutoplayControllerX10.addSubscriptions(c.addListener("finishPlayback",function(){a.setPlayingVideoUnit(null)})),this.$VideoAutoplayControllerX10.addSubscriptions(c.addListener("turnOffAutoplay",function(){a.setPlayingVideoUnit(null)}),c.addListener("pausePlayback",function(){a.$VideoAutoplayControllerX25()}),c.addListener("finishPlayback",function(){a.$VideoAutoplayControllerX25()}),b("Network").addListener("online",function(){a.$VideoAutoplayControllerX25()}),b("Network").addListener("offline",function(){a.$VideoAutoplayControllerX25()})))};d.$VideoAutoplayControllerX25=function(){__p&&__p();var a=this;if(b("VideoPlayerExperiments").webVideosBlockAutoplayWhenOffline)if(b("Network").isOnline())this.$VideoAutoplayControllerX12=this.$VideoAutoplayControllerX13;else{this.$VideoAutoplayControllerX13=this.$VideoAutoplayControllerX12;this.$VideoAutoplayControllerX12=!1;return}var d=this.getVideoUnits();for(var e=0;e1){var f=b("getViewportDimensions")().height/2;a.forEach(function(a){if(!a.isAutoplayable())return;if(b("VideoPlayerExperiments").useBringYourOwnAutoplayRule&&!c.$VideoAutoplayControllerX28(a))return;var d=a.getDOMPosition();d=d.y+d.height/2;d=Math.abs(d-f);a.playPriority=d;(!e||!e.playPriority||a.playPriority=e){this.$VideoAutoplayControllerX6=c;if(this.$VideoAutoplayControllerX5){d=this.getVisibleUnits();for(var e=0;e=0&&(c=e+1)}else{e=b("getViewportDimensions")().height/2;for(var f=0;f0){c=f;break}}}if(c===-1)return;for(var g=0;gg?b-g:0}function a(a,b){__p&&__p();var c=a;if(b.length()<1)return 0;if(a<=0)return b.start(0);for(var a=0;ac.end(d)&&(a=c.end(d));var e=a+b,f=c.end(c.length()-1),g=c.start(0);if(e<=g)return g;if(e>=f)return f;if(e>=c.start(d)&&e<=c.end(d))return e;if(ec.start(d)){if(d>=c.length()-1)return f;h=c.end(d)-a;g=b-h;e=c.start(d+1);return l(e,g,c,d+1)}return 0}function m(a,b){b==null&&(b=g);var c=a.end(a.length()-1);return l(c,-1*b,a)}function n(a,b){if(b.length()<1)return 0;var c=0;while(c1&&(c=1);else if(a.keyCode===b("Keys").DOWN)a.preventDefault(),a.stopPropagation(),c-=.05,c<0&&(c=0);else return;this.onSliderVolumeChangeEnd(c)};d.onMouseOut=function(a){b("ReactDOM").findDOMNode(this.refs.button).blur()};d.getVolume=function(){return this.props.isMuted?0:this.props.volume};d.onSliderVolumeChangeBegin=function(){var a=this.props.volume;a>0&&(this.setState({nubEngaged:!0,lastVolumeBeforeMute:a}),b("VideoPlayerVolumeSettings").saveLastVolumeBeforeMute(a))};d.onSliderVolumeChangeEnd=function(a){a>0?(this.setState({lastVolumeBeforeMute:a}),b("VideoPlayerVolumeSettings").saveLastVolumeBeforeMute(a),this.onSliderVolumeChange(a)):(this.props.onVolumeChange(this.state.lastVolumeBeforeMute),this.props.isMuted||this.props.onToggleMuted&&this.props.onToggleMuted()),this.setState({nubEngaged:!1})};d.onSliderVolumeChange=function(a){(a>0&&this.props.isMuted||a===0&&!this.props.isMuted)&&(this.props.onToggleMuted&&this.props.onToggleMuted()),this.props.onVolumeChange&&this.props.onVolumeChange(a)};d.checkLastVolumeBeforeMuteInvariant=function(){this.state.lastVolumeBeforeMute>0&&this.state.lastVolumeBeforeMute<=1||j(0,2385)};d.render=function(){__p&&__p();var a=this,c=Math.round(this.getVolume()*100),d=null,e="";if(this.props.isAudioBlocked)e=i._("Audio unavailable"),d=b("React").createElement("div",null,b("React").createElement(b("Image.react"),{className:"_rwt",src:this.props.useDarkTheme?g("797748"):g("660433")}));else if(c==0)d=b("React").createElement(b("Image.react"),{className:"_rwt",src:this.props.useDarkTheme?g("462991"):g("462993")});else{var f=null;c<=33?f=this.props.useDarkTheme?g("462983"):g("462984"):c<=66?f=this.props.useDarkTheme?g("462987"):g("462988"):f=this.props.useDarkTheme?g("462971"):g("443962");d=b("React").createElement("div",{className:"_1age"},b("React").createElement("div",{className:"_1agf"},b("React").createElement(b("Image.react"),{className:"_rwt",src:f})))}c="_2swo"+(this.state.nubEngaged?" _2yu6":"")+(this.state.focused?" _2iw8":"");f="_zbd _1agg";var h=this.getVolume()?i._("Mute"):i._("Unmute"),j=this.props.isAudioBlocked?null:b("React").createElement(b("VideoVolumeSlider.react"),{onVolumeChangeBegin:this.onSliderVolumeChangeBegin.bind(this),onVolumeChangeEnd:this.onSliderVolumeChangeEnd.bind(this),onVolumeChange:this.onSliderVolumeChange.bind(this),isHorizontal:this.props.isHorizontal||!1,volume:this.getVolume()});e=b("React").createElement(b("AbstractButton.react"),babelHelpers["extends"]({},b("TooltipData").propsFor(e,"above"),{className:f,"data-testid":"mute_unmute_control",image:d,label:h,labelIsHidden:!0,onBlur:this.onButtonBlur.bind(this),onClick:this.onButtonClick.bind(this),onFocus:this.onButtonFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),onMouseOut:this.onMouseOut.bind(this),ref:"button",tabIndex:this.props.tabIndex,type:"button"}));f=this.props.showSpatialAudioNUX?b("React").createElement(b("SpatialAudioFeedNUX.react"),{contextRef:function(){return a.refs.button}}):null;return this.props.isHorizontal?b("React").createElement("div",{className:c},e,j,f):b("React").createElement("div",{className:c},j,e,f)};return c}(b("React").Component);c.propTypes={isAudioBlocked:a.bool,isMuted:a.bool,onVolumeChange:a.func,onToggleMuted:a.func,tabIndex:a.string,volume:a.number,useDarkTheme:a.bool};c.defaultProps={isAudioBlocked:!1,useDarkTheme:!1};e.exports=c}),null); __d("VideoWithLoopingPlayback",["setImmediate"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(a,c){__p&&__p();var d=this;c===void 0&&(c=-1);this.$5=!1;this.$7=function(){var a=d.$1.getOption("FeedAutoplay","isVisibleForAutoplay"),c=d.$1.getOption("WatchAndScroll","isActive"),e=d.$1.getIsInChannel(),f=d.$1.getSource()==="tahoe";!d.$5&&(a||a===void 0)&&!c&&!e&&!f&&(!d.$4||d.$3-1?c:null;this.$6=this.$1.addListener("finishPlayback",this.$7);this.$1.registerOption("Looping","isLooping",function(){return d.$2},function(a){return d.$8(a)});this.$1.registerOption("Looping","disabled",function(){return d.$5},function(a){return d.$5=a})}var c=a.prototype;c.destroy=function(){this.$6!=null&&(this.$6.remove(),this.$6=null),this.$1.hasOption("Looping","isLooping")&&this.$1.unregisterOption("Looping","isLooping"),this.$1.hasOption("Looping","disabled")&&this.$1.unregisterOption("Looping","disabled")};c.isLooping=function(){return this.$2};c.getLoopCount=function(){return this.$3};c.getMaxLoopCount=function(){return this.$4};c.setMaxLoopCount=function(a){this.$4=a>-1?a:null};c.$8=function(a){this.$2=a};return a}();e.exports=a}),null); __d("StreamingReactionsTrayEvents",[],(function(a,b,c,d,e,f){a="streamingReactionsTray/AddReactionAnimate";b="streamingReactionsTray/HideChannelViewDetails";c="streamingReactionsTray/ShowChannelViewDetails";d="streamingReactionsTray/UpdateSurface";f="streamingReactionsTray/ResizeChannelViewWindow";var g="streamingReactionsTray/ReactionStateChange",h="streamingReactionsTray/FireworksAnimating",i="streamingReactionsTray/DisableReactions",j="streamingReactionsTray/EnableReactions";a={AddReactionAnimate:a,HideChannelViewDetails:b,ReactionStateChange:g,ResizeChannelViewWindow:f,ShowChannelViewDetails:c,UpdateSurface:d,FireworksAnimating:h,DisableReactions:i,EnableReactions:j};e.exports=a}),null); __d("VideoPollCardActionTypes",["keyMirror"],(function(a,b,c,d,e,f){"use strict";a=b("keyMirror")({MARK_POLL_CARD_ACTIVE:"",MARK_POLL_CARD_INACTIVE:""});e.exports=a}),null); __d("VideoPollCardDispatcher",["ExplicitRegistrationDispatcher"],(function(a,b,c,d,e,f){"use strict";e.exports=new(b("ExplicitRegistrationDispatcher"))({strict:!1})}),null); __d("ReactCSSTransitionGroupChild",["React","ReactDOM","ReactTransitionEvents","fbjs/lib/CSSCore"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=17;a=b("React").createClass({displayName:"ReactCSSTransitionGroupChild",propTypes:{name:b("React").PropTypes.oneOfType([b("React").PropTypes.string,b("React").PropTypes.shape({enter:b("React").PropTypes.string,leave:b("React").PropTypes.string,active:b("React").PropTypes.string}),b("React").PropTypes.shape({enter:b("React").PropTypes.string,enterActive:b("React").PropTypes.string,leave:b("React").PropTypes.string,leaveActive:b("React").PropTypes.string,appear:b("React").PropTypes.string,appearActive:b("React").PropTypes.string})]).isRequired,appear:b("React").PropTypes.bool,enter:b("React").PropTypes.bool,leave:b("React").PropTypes.bool,appearTimeout:b("React").PropTypes.number,enterTimeout:b("React").PropTypes.number,leaveTimeout:b("React").PropTypes.number},transition:function(a,c,d){__p&&__p();var e=b("ReactDOM").findDOMNode(this);if(!e){c&&c();return}var f=this.props.name[a]||this.props.name+"-"+a,g=this.props.name[a+"Active"]||f+"-active",h=null;a=function a(d){if(d&&d.target!==e)return;clearTimeout(h);b("fbjs/lib/CSSCore").removeClass(e,f);b("fbjs/lib/CSSCore").removeClass(e,g);b("ReactTransitionEvents").removeEndEventListener(e,a);c&&c()};b("fbjs/lib/CSSCore").addClass(e,f);this.queueClassAndNode(g,e);d?(h=setTimeout(a,d),this.transitionTimeouts.push(h)):b("ReactTransitionEvents").addEndEventListener(e,a)},queueClassAndNode:function(a,b){this.classNameAndNodeQueue.push({className:a,node:b}),this.timeout||(this.timeout=setTimeout(this.flushClassNameAndNodeQueue,g))},flushClassNameAndNodeQueue:function(){this.isMounted()&&this.classNameAndNodeQueue.forEach(function(a){b("fbjs/lib/CSSCore").addClass(a.node,a.className)}),this.classNameAndNodeQueue.length=0,this.timeout=null},UNSAFE_componentWillMount:function(){this.classNameAndNodeQueue=[],this.transitionTimeouts=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEach(function(a){clearTimeout(a)}),this.classNameAndNodeQueue.length=0},componentWillAppear:function(a){this.props.appear?this.transition("appear",a,this.props.appearTimeout):a()},componentWillEnter:function(a){this.props.enter?this.transition("enter",a,this.props.enterTimeout):a()},componentWillLeave:function(a){this.props.leave?this.transition("leave",a,this.props.leaveTimeout):a()},render:function(){return b("React").Children.only(this.props.children)}});e.exports=a}),null); __d("ReactTransitionChildMapping",["React","emptyFunction","warning"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=b("emptyFunction");c={getChildMapping:function(a){if(!a)return a;var c={};b("React").Children.toArray(a).forEach(function(a){var b=a.key,d=c[b]===void 0;d&&(c[b]=a)});return c},mergeChildMappings:function(a,b){__p&&__p();a=a||{};b=b||{};function c(c){if(Object.prototype.hasOwnProperty.call(b,c))return b[c];else return a[c]}var d={},e=[];for(var f in a)Object.prototype.hasOwnProperty.call(b,f)?e.length&&(d[f]=e,e=[]):e.push(f);var g,h={};for(var i in b){if(Object.prototype.hasOwnProperty.call(d,i))for(g=0;g0&&((c===o.NE||c===o.NW)&&(a.height-=d),a.top=e);d=a.left;e=b.getLeft();d=e-d;d>0&&((c===o.NW||c===o.SW)&&(a.width-=d),a.left=e);c=a.top+a.height;d=b.getTop()+b.h();e=c-d;e>0&&(a.height=d-a.top);c=a.left+a.width;e=b.getLeft()+b.w();d=c-e;d>0&&(a.width=e-a.left)};d.$16=function(a,b,c){a.widthk&&((c===o.NW||c===o.SW)&&(a.left+=a.width-k),a.width=k),a.height>k&&((c===o.NE||c===o.NW)&&(a.top+=a.height-k),a.height=k)};d.$18=function(a,b,c){__p&&__p();var d=a.width/a.height;b=b.width/b.height;if(d>b){var e=a.height*b,f=a.height;ethis.state.channelVideoElements.length)return null;a=this.state.channelVideoElements[a];return!a?null:b("React").createElement("div",{className:"_2yq3"+(c==="left"?" _2yq4":"")+(c==="center"?" _2yq5":"")+(c==="right"?" _2yq6":""),key:a.id},b("React").createElement(b("DOMContainer.react"),null,a))};d.$26=function(){return b("shouldWNSRenderToRHC")()?[]:[b("React").createElement("div",{className:"_52ua",onMouseDown:this.$10.bind(this,o.NW),key:o.NW}),b("React").createElement("div",{className:"_52uc",onMouseDown:this.$10.bind(this,o.NE),key:o.NE}),b("React").createElement("div",{className:"_52ui",onMouseDown:this.$10.bind(this,o.SE),key:o.SE}),b("React").createElement("div",{className:"_52uj",onMouseDown:this.$10.bind(this,o.SW),key:o.SW})]};d.getWidth=function(){return this.state.width};d.onLoadUpNext=function(a,b){this.props.onLoadUpNext(a,b),this.setState({hasDrawer:!0})};d.canPlayAnotherVideo=function(){var a=this.state.channelVideoElements;return this.state.videoIndexa.state.videoIndex+1||dwindow.scrollY||b==="beginPlayback"&&c&&c.reason==="autoplay_initiated")&&this.$68(a)}};c.$73=function(a){if(this.$37||a!==this.$16)return;this.$14&&this.$14.setState({endScreenShown:!0,playbackFinished:!0,timeUntilNext:this.$50?t:0})};c.$74=function(a){var b=this;return a.addListener("finishPlayback",function(){return b.$73(a)})};c.$68=function(a){var c=a.getVideoNode();if(!c.offsetParent)return;this.$19=a;this.$25=b("throttle")(this.$75.bind(this),100);window.addEventListener("resize",this.$25);this.$76(c);this.$77()};c.$75=function(){this.$19&&(this.$76(this.$18||this.$19.getVideoNode()),this.$26&&this.$26())};c.$78=function(a){__p&&__p();var b=this.$72(a),c=a.scrollWidth;a=a.scrollHeight;var d=p,e=o;cf?g-f+l:l,j=Math.max(j,l));f=i*e/d;b("VideoPlayerExperiments").rhcWNSEnabled&&(f=Math.min(f,w()));return{hasEnoughSpace:!!c||g>=a,height:f,left:j,top:h,width:i}};a.hasEnoughSpaceToEnter=function(a){if(!u||!a||!a.getVideoNode())return!1;a=a.getVideoNode();var b=1,c=parseFloat(a.getAttribute("data-original-aspect-ratio"));a=a.parentElement;(!c||b===0)&&a&&(c=a.scrollWidth,b=a.scrollHeight);a=p;ca};c.$76=function(a){__p&&__p();this.$22=this.$72(a);this.$27=a.scrollWidth;this.$28=a.scrollHeight;var b=Math.max(this.$27,this.$28);if(b.8;else return c-athis.$21||window.scrollY0?this.$87(this.$36):a);this.$49?this.$49.add(a.getVideoID()):this.$49=new Set([a.getVideoID()]);this.$14&&this.$35.length>this.$36&&this.$87(this.$36+1).preload();this.$15=this.$16.getRootNode();var h=!this.$1||!this.$16.isMuted(),i=!this.$1||this.$16.isState("playing"),j=this.$1&&this.$16.isState("finished");if(!this.$1||e){(!d||g)&&(g&&(this.$46=this.$58(this.$15)),this.$52(this.$15));if(this.$9){this.$8=this.$9;if(this.$8.videoRootNode){this.$18=this.$88(this.$8.dimensions,this.$17.getVideoNode());b("DOM").appendContent(this.$8.videoRootNode,this.$18);d=b("DOM").scry(this.$8.videoRootNode,"._344x");g=d[0];g&&b("DOM").remove(g)}}else this.$8={videoRootNode:this.$15.parentNode,dimensions:b("DOMDimensions").getElementDimensions(this.$15),source:this.$16.getSource()},this.$18=this.$88(this.$8.dimensions,this.$16.getVideoNode()),b("DOM").insertAfter(this.$15,this.$18);d=null;this.$9&&(d=this.$9.videoRootNode);!d&&this.$15&&(d=this.$15.parentNode);d&&(this.$13=b("EventListener").listen(d,"click",function(){f.$56(),a.play("user_initiated"),b("setTimeoutAcrossTransitions")(function(){f.$67(a,"beginPlayback",{reason:"user_initiated"})},r)}));this.$16.pause("user_initiated");this.$16.isPlayerVersion("silvercity")&&this.$16.detachRootNode();g=this.$7?this.$7.width:this.$6;d=this.$7?this.$7.height:this.$5;this.$16.removeOffsetStylings();this.$16.setDimensions(g,d);this.$4=!0;e&&this.$89();this.$14=this.$90();!this.$1&&b("shouldWNSRenderToRHC")()&&b("Arbiter").inform("VideoWatchAndScrollController/init");j&&this.$73(this.$16)}else this.$16.pause("user_initiated"),this.$64();i&&this.$16.play(c);if(h){this.$16.unmute();if(this.$16.getVolume()===0){g=b("VideoPlayerVolumeSettings").getLastVolumeBeforeMute()||1;this.$16.setVolume(g);this.$16.emit("unmuteVideo")}}this.$16.updateSource("watch_scroll");d=this.$33;(!this.$1||e)&&d&&(d.abandonRequest(),this.$9||d.reset(a.getVideoID(),a.getVideoChannelID()),this.$91(),this.$60(a),this.$61(a));this.$1=!0;b("shouldWNSRenderToRHC")()&&b("Arbiter").inform("VideoWatchAndScrollController/start")};c.$60=function(b){b.hasOption("WatchAndScroll","isActive")||b.registerOption("WatchAndScroll","isActive",a.isActive)};c.$61=function(a){var c=this;this.$31.addSubscriptions(this.$74(a),a.addListener("VideoChannelController/enterChannel",function(){c.$31.release()}),a.addListener("WatchAndScroll/close",function(){c.$56();var a=b("XVideoWNSSurveyController").getURIBuilder().getURI();a=new(b("AsyncRequest"))().setURI(a);a.send()}))};c.$92=function(){if(!this.$14)return;this.$14.setState({endScreenShown:!1});this.$16&&this.$16.play("user_initiated")};c.$91=function(){__p&&__p();var a=this;if(!this.$47)return;this.$33.fetchStories(!0,function(c,d){var e=a.$14;if(!c||!c.length||!e)return;c=e.getChannelVideoElements().concat(c);e.setState({channelVideoElements:c},function(){b("setTimeoutAcrossTransitions")(function(){a.$87(a.$36+1).preload()})});a.$38=a.$38.concat(d)})};c.$87=function(a){var b=this.$14?this.$14.getChannelVideoElements():[],c=[this.$17].concat(this.$35),d=null;c.forEach(function(c){b[a].contains(c.getRootNode())&&(d=c)});d||i(0,3965);return d};c.$93=function(){if(u&&u.$50)for(var a=0;ao&&(e.height=o,e.width=e.height*d);this.$16.removeOffsetStylings();this.$16.setDimensions(e.width,e.height);this.$52(c);this.$14&&this.$14.setState({playbackFinished:!1,videoIndex:this.$36,width:e.width,height:e.height},function(){b("shouldWNSRenderToRHC")()&&b("Arbiter").inform("VideoWatchAndScrollController/resize")});this.$46=e;this.$16.play("autoplay_initiated");a&&this.$16.mute();this.$35.length<=this.$36?this.$91():this.$87(this.$36+1).preload()};c.$94=function(){var a=l;this.$12&&(a+=this.$12.scrollHeight);return Math.max(a,n)};c.$52=function(a){__p&&__p();if(this.$46){this.$7={height:this.$46.height,left:this.$46.left,top:this.$46.top,width:this.$46.width};return}if(a){var b=a.scrollWidth,c=a.scrollHeight;a=this.$78(a);c=a*c/b;this.$7.height=c;this.$7.width=a}else this.$7={height:this.$5,left:l,top:this.$94(),width:this.$6}};c.$88=function(a,c){__p&&__p();var d=b("DOM").create("canvas",{className:"_57n6"});d.height=a.height;d.width=a.width;if(d.getContext&&d.getContext("2d"))if(c.scrollHeight===0){a=b("DOM").scry(c.parentNode,"._3t5i");a=a[0];if(a){var e=d.getContext("2d");e.drawImage(a,0,0)}}else if(c instanceof window.HTMLVideoElement){e=new(b("VideoFrameBuffer"))(d,c);e.updateFrameBuffer()}a=b("DOM").create("div");a.appendChild(d);c=b("DOM").create("i",{className:"_1jto _bsl _3htz"});a.appendChild(c);return a};c.$56=function(){this.$19&&this.$54();this.$16.pause("user_initiated");if(b("VideoPlayerExperiments").pauseUpNextControllerWNS){var a=this.$93();a&&a.pause("user_initiated");u&&(u.$50=null)}this.$83()};c.$95=function(){this.$16.emit("WatchAndScroll/collapse")};c.$96=function(){var a=this.$88(this.$7,this.$16.getVideoNode(),!0);this.$14&&this.$14.setState({fadeOut:!0,fadeOutPlaceholder:a});this.$97(this.$17,this.$8);this.$18&&(b("DOM").remove(this.$18),this.$18=null);this.$13&&(this.$13.remove(),this.$13=null)};c.$97=function(a,c,d){__p&&__p();a.pause("user_initiated");a.isPlayerVersion("silvercity")&&a.detachRootNode();d&&b("ReactDOM").unmountComponentAtNode(d);c.dimensions&&c.dimensions.width&&c.dimensions.height&&(a.addOffsetStylings(),a.setDimensions(c.dimensions.width,c.dimensions.height));c.videoRootNode&&b("DOM").prependContent(c.videoRootNode,a.getRootNode());a.emit("WatchAndScroll/positionUpdated");a.updateSource(c.source||"inline");d=this.$72(a.getVideoNode());c=d.top;d=b("getViewportDimensions")().height;a.getSource()!=="permalink"&&a.mute();cwindow.scrollY+d||this.$51===!1?(a.pause("autoplay_initiated"),a.emit("resumeAutoplay")):a.play("user_initiated")};c.$89=function(){var a=this;this.$4||i(0,3966);this.$40||i(0,3967);this.$40.setState({fadeOut:!0});this.$45=b("setTimeoutAcrossTransitions")(function(){a.$41||i(0,3968),a.$42||i(0,3969),a.$97(a.$41,a.$43,a.$42),a.$44&&(b("DOM").remove(a.$44),a.$44=null),a.$45=null},r)};c.$55=function(){var a=this;this.$4||i(0,3966);this.$14||i(0,3970);!this.$23&&b("shouldWNSRenderToRHC")()&&b("Arbiter").inform("VideoWatchAndScrollController/exit");this.$35.forEach(function(a){return a.abortLoading()});this.$96();this.$45=b("setTimeoutAcrossTransitions")(function(){b("ReactDOM").unmountComponentAtNode(a.$84()),a.$85()},r)};c.$85=function(){this.$4||i(0,3966),this.$33&&this.$33.abandonRequest(),this.$36=0,this.$1=!1,this.$31.release(),this.$31=new(b("SubscriptionsHandler"))(),this.$8={},this.$16=null,this.$17=null,this.$4=!1,this.$35=[],this.$38=[],this.$14=null,b("clearTimeout")(this.$45),this.$45=null,this.$41&&this.$42&&this.$43&&this.$97(this.$41,this.$43,this.$42),this.$41=null,this.$43={},this.$44&&(b("DOM").remove(this.$44),this.$44=null),b("VideoAutoplayControllerX").setShouldAutoplay(!0),this.$2=null,this.$23&&(this.$46=this.$58(this.$23.getVideoNode()),this.$66(),this.$62(this.$23,"user_initiated"),this.$23=null),this.$29=!1,this.$46=null};c.$90=function(){var a=this;return b("ReactDOM").render(b("React").createElement(b("VideoWatchAndScrollContainer.react"),{isDrawerEnabled:b("VideoPlayerExperiments").rhcWNSDrawerEnabled&&b("shouldWNSRenderToRHC")()&&b("VideoPlayerExperiments").rhcWNSExpandToTahoe,isLiveVideo:function(){return a.$16.isLiveVideo()},initialPosition:this.$7,initialVideoElement:this.$15,onChannelNavigation:this.$98.bind(this),onClick:this.$99.bind(this),onClose:this.$56.bind(this),onCollapse:this.$95.bind(this),onDrop:this.$100.bind(this),onGrab:this.$101.bind(this),onInitialPositionUpdate:this.$102.bind(this),onLoadUpNext:this.registerUpNextUnit.bind(this),onPlayNext:this.$103.bind(this),onReplay:this.$92.bind(this),viewedVideos:Array.from(this.$49),videoID:this.$16.getVideoID()}),this.$84())};c.$83=function(){this.$17&&this.$17.emit("exitWatchAndScroll");if(b("VideoPlayerExperiments").pauseUpNextControllerWNS){var a=this.$93();a&&a.emit("exitWatchAndScroll")}};c.$98=function(a){if(a>0&&this.$35.length<=this.$36){b("shouldWNSRenderToRHC")()||this.$56();return}this.$36+=a;this.$64()};c.$103=function(){var a=this.$93();a&&(this.$50=null,a.emit("crossfadeWatchAndScroll"),this.$51?a.play("autoplay_initiated"):(a.preload(),a.emit("showOverlay")))};c.$101=function(){this.$19&&this.$54();var a=this.$16.getOption("VideoWithLiveBroadcast","isLive");if(a)return;this.$24=this.$16.isState("playing");this.$16.pause("user_initiated")};c.$100=function(){var a=this.$16.getOption("VideoWithLiveBroadcast","isLive");if(a)return;this.$24&&this.$16.play("user_initiated");this.$24=null};c.$99=function(){var a=this.$16.getOption("VideoWithLiveBroadcast","isLive");if(this.$19||a)return;this.$16.isState("playing")?this.$16.pause("user_initiated"):(this.$16.isState("paused")||this.$16.isState("finished")||this.$16.isState("ready"))&&this.$16.play("user_initiated")};c.$86=function(a){__p&&__p();var c=this;if(this.$16===a)return;b("VideoPlayerExperiments").rhcWNSEnabled&&a.addListener("WatchAndScroll/collapse",function(){if(a!=c.$16){a.removeCurrentListener();return}if(!b("shouldWNSRenderToRHC")())return;b("Arbiter").inform("VideoWatchAndScrollController/collapse")});this.$16=a};c.pauseActiveVideo=function(a){if(!this.$16)return;this.$16.pause(a)};a.pauseActiveVideo=function(a){a===void 0&&(a="user_initiated");if(!u)return;u.pauseActiveVideo(a)};c.playActiveVideo=function(a){if(!this.$16)return;this.$16.play(a)};c.registerUpNextUnit=function(a,c){__p&&__p();var d=b("DOM").find(a,"._3iqr");if(!u||!d)return;u.$50=a;u.$51=c;b("EventListener").listen(d,"click",function(a){if(!u)return;var b=u.$93();b&&(a.preventDefault(),a.stopPropagation(),u.$50=null,b.emit("crossfadeWatchAndScroll"),b.play("user_initiated"))})};a.playActiveVideo=function(a){a===void 0&&(a="user_initiated");if(!u)return;u.playActiveVideo(a)};c.$102=function(a){this.$7=a,this.$14&&!this.$14.getFadeOutStatus()&&(this.$16.removeOffsetStylings(),this.$16.setDimensions(a.width,a.height),this.$16.emit("WatchAndScroll/positionUpdated"))};c.$104=function(){var a=b("DOM").create("div");b("shouldWNSRenderToRHC")()?b("ifRequired")("RHCVideoWNSController",function(b){return b.mount(a)}):b("DOM").appendContent(document.body,a);return a};c.$84=function(){this.$2||(this.$2=this.$104());return this.$2};return a}();e.exports=a}),null);